var WXads = require('WXAds');
var QQAds = require('QQAds');
window.AdsUtil = cc.Class({
    extends: cc.Component,

    properties: {
    },

    statics: {
        //显示Baner广告

        showBaner: function () {
            if(SystemInfo.getPlatform() == 'weChatGame'||SystemInfo.getPlatform() == 'weChat'){
                WXads.showBanner();
            } else if (SystemInfo.getPlatform() == 'qqPlay') {
                QQAds.showBanner(true);
            }
        },

        hideBanner: function () {
            if(SystemInfo.getPlatform() == 'weChatGame'||SystemInfo.getPlatform() == 'weChat'){

            } else if (SystemInfo.getPlatform() == 'qqPlay') {
                QQAds.hideBanner();
            }
        },

        showVideo: function (callback) {
            Log.info('进入播视频环节')

            SoundUtil.pauseMusic();

            SystemInfo.setIsPlayingVideo(true)
            Log.info('暂停音乐了读取平台信息 = ',SystemInfo.getPlatform())

            if(SystemInfo.getPlatform() == 'weChatGame'||SystemInfo.getPlatform() == 'weChat'){
                WXads.showVide(callback);
            } else if (SystemInfo.getPlatform() == 'qqPlay') {
                Log.info('QQ玩一玩平台 进入QQ玩一玩播放视频节目')
                QQAds.showVideo(callback);
            }else{
                callback(true);
            }
        },



    }
});

module.exports = AdsUtil;

